﻿using FluentValidation;
using Nop.Services.Localization;
using Nop.Web.Framework.Validators;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nop.Plugin.Misc.TabManager.Domain
{
    public class MessageDesignValidator : BaseNopValidator<Tab>
    {
        public MessageDesignValidator(ILocalizationService localizationService)
        {
            DefaultValidatorOptions.WithMessage<Tab, string>(DefaultValidatorExtensions.NotEmpty<Tab, string>(base.RuleFor<string>(x => x.TabName)), localizationService.GetResource("Plugins.Misc.Tabmanager.Fields.TabName.Required"));
            DefaultValidatorOptions.WithMessage<Tab, string>(DefaultValidatorExtensions.NotEmpty<Tab, string>(base.RuleFor<string>(x => x.Title)), localizationService.GetResource("Plugins.Misc.Tabmanager.Fields.Title.Required"));
        }
    }

   /* public class TabValidator : AbstractValidator<Tab>
    {
        public TabValidator(ILocalizationService localizationService)
        {
            //RuleFor(x => x.TabName)
            //    .NotEmpty().WithMessage(localizationService.GetResource("Plugins.Widgets.TabManager.TabRequired"));

            //RuleFor(x => x.Title)
            //    .NotEmpty().WithMessage(localizationService.GetResource("Plugins.Widgets.TabManager.TitleRequired"));
        }
    }*/
}
